﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace Hzexe.Wechat.SharpSDK.Message.Response
{
    /// <summary>
    /// 图文消息
    /// </summary>
    [Serializable]
    [XmlRoot("xml")]
    public class Message_Out_News : ResponseMessageBase
    {
        /// <summary>
        /// 用请求包初始化一个回复包
        /// </summary>
        /// <param name="request">请求包对象</param>
        public Message_Out_News(Hzexe.Wechat.SharpSDK.Message.Request.RequestMessageBase request)
            : this()
        {
            this.FromUserName = request.ToUserName; //回复包的发送者
            this.ToUserName = request.FromUserName;//回复包的接收者
        }
        public Message_Out_News()
            : base()
        {
            this.Articles = new ArticleCollection();
        }

        /// <summary>
        /// 图文数
        /// </summary>
        public int ArticleCount
        {
            get
            {
                return (null == Articles) ? 0 : Articles.Count;
            }
            set { ;}
        }
        /// <summary>
        /// 图文集合
        /// </summary>
        /// <remarks>公众平台限制为10条以内 </remarks>
        [XmlArray(ElementName = "Articles")]
        [XmlArrayItem(ElementName = "item")]
        public ArticleCollection Articles { get; set; }
    }
}
